import Vue from 'vue'
import Router from 'vue-router'
import Home from '../containers/Home/home'
import Sports from '../containers/Sports/sports'
import Find from '../containers/Find/find'


//Username
import Banner from '../components/UserName/banner'
import StartPage from '../components/UserName/startPage'
import Login from '../components/UserName/login'
import Register from '../components/UserName/register'

//home页
import AllMovement from '../containers/Home/HomePage/allMovement'
import Cycling from '../containers/Home/HomePage/cycling'
import Run from '../containers/Home/HomePage/run'
import Walking from '../containers/Home/HomePage/walking'
import RunRecord from '../components/RunRecord'

//定位 设置
import Maps from '../containers/Maps'
import Setting from '../containers/Setting'

//个人主页
import Mine from '../containers/Mine/mine'


//健身二级路由
import Coach from "../containers/SubSports/coach.vue"
import Course from "../containers/SubSports/course.vue"
import Material from "../containers/SubSports/material.vue"
import Training from "../containers/SubSports/training.vue"

import Own from '../containers/Mine/SubPages/own'

//个人资料页
import PersonInfo from '../containers/Mine/SubPages/personInfo'


Vue.use(Router)

export default new Router({
  linkActiveClass:'fed906-active',
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect:'/allmovement',
      children:[
        {
          path:'allmovement',
          component:AllMovement
        },
        {
          path:'cycling',
          component:Cycling,
        },
        {
          path:'run',
          component:Run
        },
        {
          path:'walking',
          component:Walking
        }
      ]
    },
    {
      path: '/sports',
      name: 'Sports',
      component: Sports,
        children:[
          {
            path:"coach",
            component:Coach
          },
          {
            path:"course",
            component:Course
          },
          {
            path:"material",
            component:Material
          },
          {
            path:"training",
            component:Training
          }
        ]
    },
    {
      path: '/find',
      name: 'Find',
      component: Find
    },
    {
      path: '/mine',
      name: 'Mine',
      component: Mine,
      redirect:'/mine/own',
      children: [
        {
          path: '/mine/own',
          name: 'Own',
          component: Own
        },
        {
          path:'personinfo', //个人资料页
          name:'PersonInfo',
          component: PersonInfo
        }
      ]
    },
    {
      path: '/banner',
      name: 'Banner',
      component: Banner
    },
    {
      path: '/startpage',
      name: 'StartPage',
      component: StartPage
    },
    {
      path: '/login',//登录
      name: 'Login',
      component: Login
    },
    {
      path: '/register',//注册
      name: 'Register',
      component: Register
    },
    {
      path:'/maps',//定位
      component:Maps,
    },
    {
      path:'/setting',//设置
      component:Setting,
      children:[
        {
          path:'runrecord',//跑步记录
          component:RunRecord
        }
      ]
    }
  ]
})
